/********************************************************
 Name          : main.c
 Author        : Nipun Batra
 Copyright     : Apache 2
 Description   : Turn on 3 leds using GPIO Register and also toggle every second bi color LED
 **********************************************************/

// Include Files 
#include "board.h"



#include "gpio.h"
#include "delay.h"
//#include "adc.h"

void enable_and_clear(int pin)
{
	gpio_enable_gpio_pin(pin);
	gpio_local_init();
	gpio_local_enable_pin_output_driver(pin);
	gpio_clr_gpio_pin(pin);
}

void enable_and_set(int pin)
{
	gpio_enable_gpio_pin(pin);
	gpio_local_init();
	gpio_local_enable_pin_output_driver(pin);
	gpio_set_gpio_pin(pin);
}


int main(void) {

	int i;
	delay_init(12000);//CPU Frequency
	for(i=59;i<62;i++)
	{
		gpio_enable_gpio_pin(i);
		gpio_local_init();
		gpio_local_enable_pin_output_driver(i);
		gpio_clr_gpio_pin(i);
	}

	while(1)
	{
		enable_and_set(53);
		enable_and_clear(54);
		delay_ms(10000);
		enable_and_set(54);
		enable_and_clear(53);
		delay_ms(10000);



	}
}
